package cn.yunbamboos.db;

import cn.yunbamboos.db.metadata.TableMetadata;
import cn.yunbamboos.db.sql.GenerateH2Sql;
import cn.yunbamboos.db.sql.GenerateMySQLSql;
import cn.yunbamboos.db.sql.GenerateSql;

public class GenerateSqlFactory {

    public static GenerateSql generate(TableMetadata tableMetadata) {
        String driver = System.getProperty("DB_DRIVER");
        if ("com.mysql.cj.jdbc.Driver".equals(driver)) {
            return new GenerateMySQLSql(tableMetadata);
        } else if ("org.h2.Driver".equals(driver)) {
            return new GenerateH2Sql(tableMetadata);
        }
        return null;
    }
}
